package com.tmsps.common.util.result;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 *  返回类
 *
 * Copyright 2020 nuoyun All rights reserved.
 * @author dongxujiao
 * @version V1.0
 */
@Getter @Setter
@NoArgsConstructor
public class ResponseBean<T> implements Serializable {

    private String code;

    private String msg;

    private T data;

    public ResponseBean(ResponseCodeEnum responseCodeEnum) {
        this.code= responseCodeEnum.getCode();
        this.msg= responseCodeEnum.getMsg();
    }

    public ResponseBean(ResponseCodeEnum responseCodeEnum, T data) {
        this.code = responseCodeEnum.getCode();
        this.msg = responseCodeEnum.getMsg();
        this.data = data;
    }

    public ResponseBean(ResponseCodeEnum responseCodeEnum, String msg, T data) {
        super();
        this.code = responseCodeEnum.getCode();
        this.msg = msg;
        this.data = data;
    }

    public ResponseBean(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseBean(String code, String msg, T data) {
        super();
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
